<?php

if(!$_SESSION['user']['username']){
	//redirect(BASE_URL);
}


if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
	require_once 'libraries/function/validateAjax.php';
	
}else{die();}


switch($_GET['act']){
case "manga":
require("controllers/ajax/modules/manga/controller.php");
break;
case "truyen":
require("controllers/ajax/modules/truyen/controller.php");
break;
case "video":
require("controllers/ajax/modules/video/controller.php");
break;	
case "blog":
require("controllers/ajax/modules/blog/controller.php");
break;	
case "user":
require("controllers/ajax/modules/user/controller.php");
break;	
case "ajax":
require("controllers/ajax/ajax.php");
break;	

case "comment":
require("controllers/comment/add.php");
break;			
	
}


switch($_POST['act']){
case "manga":
require("controllers/ajax/modules/manga/controller.php");
break;
case "truyen":
require("controllers/ajax/modules/truyen/controller.php");
break;
case "video":
require("controllers/ajax/modules/video/controller.php");
break;	
case "blog":
require("controllers/ajax/modules/blog/controller.php");
break;	
case "user":
require("controllers/ajax/modules/user/controller.php");
break;	
case "fansub":
	require("controllers/ajax/modules/manga/fansub.php");
	break;
case "ajax":
require("controllers/ajax/ajax.php");
break;	
	
}